

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Show Activity</title>
    </head>
    <body>
        <div class="body">
            <h1>活動</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table>
                    <tbody>
                        <tr class="prop">
                            <td valign="top" class="name">名稱:</td>
                            
                            <td valign="top" class="value">${fieldValue(bean:activityInstance, field:'name')}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name">開始:</td>
                            <td valign="top" class="value">${fieldValue(bean:activityInstance, field:'startAt')}</td>
                        </tr>

 						<tr class="prop">
                            <td valign="top" class="name">結束:</td>
                            <td valign="top" class="value">${fieldValue(bean:activityInstance, field:'endAt')}</td>
                        </tr>
                        
                        <tr class="prop">
                            <td valign="top" class="name">應出席人員:</td>
                            <td  valign="top" style="text-align:left;" class="value">
                                <table>
                                <tr><td>姓名</td><td>簽到</td><td>簽退</td></tr>
                                <g:each var="r" in="${activityInstance.records}">
                                <tr>
                                    <td><g:link controller="person" action="show" id="${ r.person.id }">${r.person.name}</g:link></td>
                                    <td>
                                    	<g:if test="${r.status != Status.NONREGISTERED.toString() && r.registerDate.getYear() > 70}">
											${ r.registerDate }
                                    	</g:if>
                                    </td>
                                    <td>
                                    	<g:if test="${r.status == Status.DONE.toString() || r.status == Status.OTHERDONE.toString()}">
                                    		${ r.doneDate }
                                    	</g:if>
                                    </td>
                                </tr>
                                </g:each>
                                </table>
                            </td>
                        </tr>
                    
                    </tbody>
                </table>
            </div>
            <div class="buttons">
                <g:form>
                    <input type="hidden" name="id" value="${activityInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="編輯"/></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" action="delete" value="刪除"/></span>
                </g:form>
            </div>
        </div>
    </body>
</html>
